home *** CD-ROM | disk | FTP | other *** search
/ Diccionario Visual Trilingue / VISUAL.iso / SHARED.DIR / 10140_Position de titres.ls < prev    next >
Encoding:
Text File  |  1997-07-04  |  1.3 KB  |  39 lines

  1. on mouseDown
  2.   global gCurrentPosC, gNbItemC
  3.   set Delta to the mouseV - the locV of sprite 20
  4.   set TempV to the mouseV - Delta
  5.   set TempV2 to the mouseV
  6.   set CurrentP to getAt(gCurrentPosC, 2)
  7.   repeat while the mouseDown
  8.     if rollOver(19) and (TempV2 <> the mouseV) then
  9.       set TempV to the mouseV - Delta
  10.       set TempV2 to the mouseV
  11.       if TempV > (SpriteBottom(19) - (SpriteHeight(20) / 2)) then
  12.         set the locV of sprite 20 to SpriteBottom(19) - (SpriteHeight(20) / 2)
  13.       else
  14.         if TempV < (SpriteTop(19) + (SpriteHeight(20) / 2)) then
  15.           set the locV of sprite 20 to SpriteTop(19) + (SpriteHeight(20) / 2)
  16.         else
  17.           set the locV of sprite 20 to TempV
  18.         end if
  19.       end if
  20.       updateStage()
  21.       set Percent to (the locV of sprite 20 - SpriteTop(19) - (SpriteHeight(20) / 2)) / ((SpriteHeight(19) - SpriteHeight(20)) * 1.0)
  22.       if Percent >= 1 then
  23.         setAt(gCurrentPosC, 2, getAt(gNbItemC, 2) - 20)
  24.       else
  25.         if Percent = 0 then
  26.           setAt(gCurrentPosC, 2, 1)
  27.         else
  28.           setAt(gCurrentPosC, 2, integer(Percent * (getAt(gNbItemC, 2) - 21)) + 1)
  29.         end if
  30.       end if
  31.       if getAt(gCurrentPosC, 2) <> CurrentP then
  32.         set CurrentP to getAt(gCurrentPosC, 2)
  33.         SetWinContenu2(2, 14)
  34.       end if
  35.     end if
  36.   end repeat
  37.   ActiveFieldC(2)
  38. end
  39.